classdef amcscan < handle
    %AMSCAN Summary of this class goes here
    %   Detailed explanation goes here
    
    properties
        loops
        data
        consts
    end
    
    methods
        %check if any plots refer to channels that no longer exist and
        %delete them
        function checkplots(ams)
            allsetgetchans=ams.loops.allchans;
            for i=1:length(ams.loops)
                isbad=zeros(1,length(ams.loops(i).plots));
                for j=1:length(ams.loops(i).plots)
                    if any(ismember(ams.loops(i).plots(j).allchans,allsetgetchans))
                        isbad(j)=1;
                    end
                    ams.loops(i).plots(isbad)=[];
                end
            end
        end
    end
    
end

